package domijn;

import daoDataFactory.DbObject;


public class Categorie implements Comparable<Categorie>{

	
	private int CategorieID;
	private String CatName;
	private String CatNName;
	private Gerecht g;
	private Drank d;
	
	
	public Categorie(int categorieID, String catName) {
		this.CategorieID = categorieID;
		this.CatName = catName;
	}

	public Categorie(String catName, String catNName) {
		this.CatName = catName;
		this.CatNName = catNName;
	}
	
	public Categorie(String catName) {
		this.CatName = catName;
	}
	
	
	public String getCatNName() {
		return CatNName;
	}

	public void setCatNName(String catNName) {
		CatNName = catNName;
	}

	public Gerecht getG() {
		return g;
	}

	public void setG(Gerecht g) {
		this.g = g;
	}

	public Drank getD() {
		return d;
	}

	public void setD(Drank d) {
		this.d = d;
	}

	public int getCategorieID() {
		return CategorieID;
	}
	public void setCategorieID(int categorieID) {
		CategorieID = categorieID;
	}


	public String getCatName() {
		return CatName;
	}
	public void setCatName(String catName) {
		this.CatName = catName;
	}

	
	public String toString() {
		return  CatName;
	}
	
	public int compareTo(Categorie c) {
		int a = Integer.parseInt(CatName);
		int b = Integer.parseInt(c.getCatName());
		boolean d = a == b;
		if (d == false) {
			return a;
		}
		else {
			return b;
		}
	}
	
	public void save(){
		DbObject.getwokapplicatie().getDaoICategorie().save(this);
		System.out.println("hallo");
	}
	public void update (){
		DbObject.getwokapplicatie().getDaoICategorie().update(this);
	}
	public void delete (){
		DbObject.getwokapplicatie().getDaoICategorie().delete(this);
	}
	public void find(){
		DbObject.getwokapplicatie().getDaoICategorie().find(this);
	}
	public void loadall(){
		DbObject.getwokapplicatie().getDaoICategorie().loadall();	
	}
}
